package org.xq.softcup.mq.remoting.invoker.call;

public abstract class XQRpcInvokeCallback<T>
{
    private static ThreadLocal<XQRpcInvokeCallback> threadInvokerFuture = new ThreadLocal();

    public abstract void onSuccess(T paramT);

    public abstract void onFailure(Throwable paramThrowable);

    public static XQRpcInvokeCallback getCallback()
    {
        XQRpcInvokeCallback invokeCallback = (XQRpcInvokeCallback)threadInvokerFuture.get();
        threadInvokerFuture.remove();
        return invokeCallback;
    }

    public static void setCallback(XQRpcInvokeCallback invokeCallback)
    {
        threadInvokerFuture.set(invokeCallback);
    }

    public static void removeCallback()
    {
        threadInvokerFuture.remove();
    }
}